import request from '@/utils/request'

// api地址
const api = {
  userInfo: '/api/user/info',
  assets: '/api/user/assets',
  getUserInfo: '/mxty/user/getUserInfo',
  isCoach: '/mxty/coach/isCoach',
  courseStudents: '/mxty/coach/courseStudents',
  setUserInfo: '/mxty/user/setUserInfo',
  isSetInfo: '/mxty/user/isSetInfo',
}

// 当前登录的用户信息
export const info = (param, option) => {
  const options = {
    isPrompt: true, //（默认 true 说明：本接口抛出的错误是否提示）
    load: true, //（默认 true 说明：本接口是否提示加载动画）
    ...option
  }
  return request.get(api.userInfo, param, options)
}

// 账户资产
export const assets = (param, option) => {
  return request.get(api.assets, param)
}

// 账户资产
export const isCoach = (param, option) => {
  return request.get(api.isCoach, param)
}


// 获取课程的所有学生
export const courseStudents = (param) => {
  return request.get(api.courseStudents, param)
}

// 获取用户姓名和手机号
export const getUserInfo = (param) => {
  return request.get(api.getUserInfo, param)
}

// 修改用户姓名和手机号
export const setUserInfo = (param) => {
  return request.get(api.setUserInfo, param)
}

// 判断用户姓名和手机号是否已设置
export const isSetInfo = (param) => {
  return request.get(api.isSetInfo, param)
}